GtkFontChooser: Create functions to bootstrap the treeview column and settings and...
authorAlberto Ruiz <aruiz@gnome.org>
Fri, 15 Apr 2011 23:28:02 +0000 (00:28 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 15 Aug 2011 22:57:51 +0000 (18:57 -0400)
gtk/gtkfontchooser.c

index 98c27552e5e37409bf80c9e428ee9e8a552d5d2e..15fe462bdaa08fcb9f9863d0748d370a4fbef5cd 100644 (file)
@@ -148,16 +148,8 @@ enum {
 
 enum {
   FAMILY_COLUMN,
-  FAMILY_NAME_COLUMN
-};
-
-enum {
   FACE_COLUMN,
-  FACE_NAME_COLUMN
-};
-
-enum {
-  SIZE_COLUMN
+  FACE_TEXT_COLUMN
 };
 
 static void    gtk_font_selection_set_property       (GObject         *object,
@@ -177,6 +169,7 @@ static void     gtk_font_selection_ref_family            (GtkFontSelection *font
                                                          PangoFontFamily  *family);
 static void     gtk_font_selection_ref_face              (GtkFontSelection *fontsel,
                                                          PangoFontFace    *face);
+static void gtk_font_selection_bootstrap_fontlist (GtkTreeView* treeview);
 
 G_DEFINE_TYPE (GtkFontSelection, gtk_font_selection, GTK_TYPE_VBOX)
 
@@ -347,6 +340,8 @@ gtk_font_selection_init (GtkFontSelection *fontsel)
   gtk_widget_show_all (GTK_WIDGET (fontsel));
   gtk_widget_hide (GTK_WIDGET (fontsel));
 
+  gtk_font_selection_bootstrap_fontlist (priv->family_face_list);
+
   gtk_widget_pop_composite_child();
 }
 
@@ -367,6 +362,27 @@ gtk_font_selection_new (void)
   return GTK_WIDGET (fontsel);
 }
 
+
+static void 
+gtk_font_selection_populate_model (GtkTreeModel *model)
+{
+}
+
+static void
+gtk_font_selection_bootstrap_fontlist (GtkTreeView* treeview)
+{
+  GtkTreeModel *fonts_model;
+  
+  fonts_model = gtk_list_store_new (3,
+                                    PANGO_TYPE_FONT_FAMILY,
+                                    PANGO_TYPE_FONT_FACE,
+                                    G_TYPE_STRING);
+  gtk_tree_view_set_model (treeview, GTK_TREE_MODEL (fonts_model));
+
+  gtk_font_selection_populate_model (GTK_TREE_MODEL (fonts_model));  
+}
+
+
 static void
 gtk_font_selection_finalize (GObject *object)
 {